
<%@ page import="com.trivia.Scoring" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'scoring.label', default: 'Scoring')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
        <nav:resources/>
    </head>
    <body>
        <div id="menu" class="nav">
		    <nav:render/>
        </div>
        <div class="nav">
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'scoring.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="correctAnswers" title="${message(code: 'scoring.correctAnswers.label', default: 'Correct Answers')}" />
                        
                            <g:sortableColumn property="incorrectAnswers" title="${message(code: 'scoring.incorrectAnswers.label', default: 'Incorrect Answers')}" />
                        
                            <g:sortableColumn property="notAnswers" title="${message(code: 'scoring.notAnswers.label', default: 'Not Answers')}" />
                        
                        	<g:sortableColumn property="appTrivia" title="${message(code: 'scoring.appTrivia.label', default: 'App Trivia')}" />
<%--                            <th><g:message code="scoring.appTrivia.label" default="App Trivia" /></th>--%>
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${scoringInstanceList}" status="i" var="scoringInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${scoringInstance.id}">${fieldValue(bean: scoringInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: scoringInstance, field: "correctAnswers")}</td>
                        
                            <td>${fieldValue(bean: scoringInstance, field: "incorrectAnswers")}</td>
                        
                            <td>${fieldValue(bean: scoringInstance, field: "notAnswers")}</td>
                        
                            <td>${fieldValue(bean: scoringInstance, field: "appTrivia.appName")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${scoringInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
